<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>Class: tinymce.html.Schema</title>
<meta name="generator" content="MoxieDoc" />

<link rel="stylesheet" type="text/css" href="css/reset.css" />
<link rel="stylesheet" type="text/css" href="css/grids.css" />
<link rel="stylesheet" type="text/css" href="css/general.css" />

<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
	google.load("jquery", "1.3");
</script>
<script type="text/javascript" src="js/jquery.treeview.min.js"></script>
<script type="text/javascript" src="js/general.js"></script>
</head>
<body>
<div class="classDetailsContent">
<h1>tinymce.html.Schema</h1>
<table class="classDetails">
<tr>
<td class="first">Namespace</td>
<td class="last">tinymce.html</td>
</tr>
<tr>
<td class="first">Class</td>
<td class="last">Schema</td>
</tr>
</table>
<div class="classDescription">Schema validator class.
</div>
<div class="version">
<span>Version:</span>3.4</div>
<h4>Example</h4>
<pre class="brush: js;"/>
<div class="summaryLists">
<h2>Public Methods</h2>
<table class="Methods summary">
<thead>
<tr>
<th>Method</th>
<th>Defined By</th>
</tr>
</thead>
<tbody>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#Schema">Schema</a>(settings:Object)</div>
<div class="summary">Constructs a new Schema instance.</div>
</td>
<td class="last">Schema</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#addCustomElements">addCustomElements</a>(custom_elements:String):void</div>
<div class="summary">Adds custom non HTML elements to the schema.</div>
</td>
<td class="last">Schema</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#addValidChildren">addValidChildren</a>(valid_children:String):void</div>
<div class="summary">Parses a valid children string and adds them to the schema structure.</div>
</td>
<td class="last">Schema</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#addValidElements">addValidElements</a>(valid_elements:String):void</div>
<div class="summary">Parses a valid elements string and adds it to the schema.</div>
</td>
<td class="last">Schema</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#getBlockElements">getBlockElements</a>():Object</div>
<div class="summary">Returns a map with block elements.</div>
</td>
<td class="last">Schema</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#getBoolAttrs">getBoolAttrs</a>():Object</div>
<div class="summary">Returns a map with boolean attributes.</div>
</td>
<td class="last">Schema</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#getCustomElements">getCustomElements</a>():Object</div>
<div class="summary">Returns an map object of all custom elements.</div>
</td>
<td class="last">Schema</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#getElementRule">getElementRule</a>(name:String):Object</div>
<div class="summary">Returns true/false if the specified element is valid or not according to the schema.</div>
</td>
<td class="last">Schema</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#getNonEmptyElements">getNonEmptyElements</a>():Object</div>
<div class="summary">Returns a map with elements that should be treated as contents regardless if it has text content in them or not such as ...</div>
</td>
<td class="last">Schema</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#getSelfClosingElements">getSelfClosingElements</a>():Object</div>
<div class="summary">Returns a map with self closing tags such as .</div>
</td>
<td class="last">Schema</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#getShortEndedElements">getShortEndedElements</a>():Object</div>
<div class="summary">Returns a map with short ended elements such as BR or IMG.</div>
</td>
<td class="last">Schema</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#getTextBlockElements">getTextBlockElements</a>():Object</div>
<div class="summary">Returns a map with text block elements.</div>
</td>
<td class="last">Schema</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#getWhiteSpaceElements">getWhiteSpaceElements</a>():Object</div>
<div class="summary">Returns a map with elements where white space is to be preserved like PRE or SCRIPT.</div>
</td>
<td class="last">Schema</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#isValid">isValid</a>(name:String, attr:String):Boolean</div>
<div class="summary">Returns true/false if the specified element name and optional attribute is valid according to the schema.</div>
</td>
<td class="last">Schema</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#isValidChild">isValidChild</a>(name:String, child:String):Boolean</div>
<div class="summary">Returns true/false if the specified element and it's child is valid or not according to the schema.</div>
</td>
<td class="last">Schema</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinymce.html.Schema.html#setValidElements">setValidElements</a>(valid_elements:String):void</div>
<div class="summary">Parses a valid elements string and sets it to the schema.</div>
</td>
<td class="last">Schema</td>
</tr>
</tbody>
</table>
</div>
<div class="detailsList">
<div class="details">
<h2>Method details</h2>
<div class="memberDetails" id="Schema">
<h3>Schema<span class="memberType">constructor</span>
</h3>
<code class="syntax">public 
						function Schema(settings:Object)</code>
<div class="memberDescription">Constructs a new Schema instance.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">settings:Object</td>
<td class="last">Name/value settings object.</td>
</tr>
</table>
</div>
<div class="memberDetails" id="addCustomElements">
<h3>addCustomElements<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function addCustomElements(custom_elements:String):void</code>
<div class="memberDescription">Adds custom non HTML elements to the schema.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">custom_elements:String</td>
<td class="last">Comma separated list of custom elements to add.</td>
</tr>
</table>
</div>
<div class="memberDetails" id="addValidChildren">
<h3>addValidChildren<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function addValidChildren(valid_children:String):void</code>
<div class="memberDescription">Parses a valid children string and adds them to the schema structure. The valid children format is for example: "element[child1|child2]".
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">valid_children:String</td>
<td class="last">Valid children elements string to parse</td>
</tr>
</table>
</div>
<div class="memberDetails" id="addValidElements">
<h3>addValidElements<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function addValidElements(valid_elements:String):void</code>
<div class="memberDescription">Parses a valid elements string and adds it to the schema. The valid elements format is for example "element[attr=default|otherattr]".
Existing rules will be replaced with the ones specified, so this extends the schema.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">valid_elements:String</td>
<td class="last">String in the valid elements format to be parsed.</td>
</tr>
</table>
</div>
<div class="memberDetails" id="getBlockElements">
<h3>getBlockElements<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function getBlockElements():Object</code>
<div class="memberDescription">Returns a map with block elements.
</div>
<h4>Returns</h4>
<div class="returns">Object - Name/value lookup map for block elements.</div>
</div>
<div class="memberDetails" id="getBoolAttrs">
<h3>getBoolAttrs<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function getBoolAttrs():Object</code>
<div class="memberDescription">Returns a map with boolean attributes.
</div>
<h4>Returns</h4>
<div class="returns">Object - Name/value lookup map for boolean attributes.</div>
</div>
<div class="memberDetails" id="getCustomElements">
<h3>getCustomElements<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function getCustomElements():Object</code>
<div class="memberDescription">Returns an map object of all custom elements.
</div>
<h4>Returns</h4>
<div class="returns">Object - Name/value map object of all custom elements.</div>
</div>
<div class="memberDetails" id="getElementRule">
<h3>getElementRule<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function getElementRule(name:String):Object</code>
<div class="memberDescription">Returns true/false if the specified element is valid or not
according to the schema.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">name:String</td>
<td class="last">Element name to check for.</td>
</tr>
</table>
<h4>Returns</h4>
<div class="returns">Object - Element object or undefined if the element isn't valid.</div>
</div>
<div class="memberDetails" id="getNonEmptyElements">
<h3>getNonEmptyElements<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function getNonEmptyElements():Object</code>
<div class="memberDescription">Returns a map with elements that should be treated as contents regardless if it has text
content in them or not such as TD, VIDEO or IMG.
</div>
<h4>Returns</h4>
<div class="returns">Object - Name/value lookup map for non empty elements.</div>
</div>
<div class="memberDetails" id="getSelfClosingElements">
<h3>getSelfClosingElements<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function getSelfClosingElements():Object</code>
<div class="memberDescription">Returns a map with self closing tags such as <li>.
</div>
<h4>Returns</h4>
<div class="returns">Object - Name/value lookup map for self closing tags elements.</div>
</div>
<div class="memberDetails" id="getShortEndedElements">
<h3>getShortEndedElements<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function getShortEndedElements():Object</code>
<div class="memberDescription">Returns a map with short ended elements such as BR or IMG.
</div>
<h4>Returns</h4>
<div class="returns">Object - Name/value lookup map for short ended elements.</div>
</div>
<div class="memberDetails" id="getTextBlockElements">
<h3>getTextBlockElements<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function getTextBlockElements():Object</code>
<div class="memberDescription">Returns a map with text block elements. Such as: p,h1-h6,div,address
</div>
<h4>Returns</h4>
<div class="returns">Object - Name/value lookup map for block elements.</div>
</div>
<div class="memberDetails" id="getWhiteSpaceElements">
<h3>getWhiteSpaceElements<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function getWhiteSpaceElements():Object</code>
<div class="memberDescription">Returns a map with elements where white space is to be preserved like PRE or SCRIPT.
</div>
<h4>Returns</h4>
<div class="returns">Object - Name/value lookup map for white space elements.</div>
</div>
<div class="memberDetails" id="isValid">
<h3>isValid<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function isValid(name:String, attr:String):Boolean</code>
<div class="memberDescription">Returns true/false if the specified element name and optional attribute is
valid according to the schema.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">name:String</td>
<td class="last">Name of element to check.</td>
</tr>
<tr>
<td class="first">attr:String</td>
<td class="last">Optional attribute name to check for.</td>
</tr>
</table>
<h4>Returns</h4>
<div class="returns">Boolean - True/false if the element and attribute is valid.</div>
</div>
<div class="memberDetails" id="isValidChild">
<h3>isValidChild<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function isValidChild(name:String, child:String):Boolean</code>
<div class="memberDescription">Returns true/false if the specified element and it's child is valid or not
according to the schema.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">name:String</td>
<td class="last">Element name to check for.</td>
</tr>
<tr>
<td class="first">child:String</td>
<td class="last">Element child to verify.</td>
</tr>
</table>
<h4>Returns</h4>
<div class="returns">Boolean - True/false if the element is a valid child of the specified parent.</div>
</div>
<div class="memberDetails last" id="setValidElements">
<h3>setValidElements<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function setValidElements(valid_elements:String):void</code>
<div class="memberDescription">Parses a valid elements string and sets it to the schema. The valid elements format is for example "element[attr=default|otherattr]".
Existing rules will be replaced with the ones specified, so this extends the schema.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">valid_elements:String</td>
<td class="last">String in the valid elements format to be parsed.</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</body>
</html>
